<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:sistema="http://sistema.com.br/jsf">

	<ui:composition template="../templates/main.xhtml">

		<ui:define name="keepAl">
			<a4j:keepAlive beanName="loginMB"/>
		</ui:define>

		<ui:define name="head">
			
		</ui:define>

		<ui:define name="carregar">
			<h:outputText value="#{loginMB.carregar}" />
		</ui:define>

		<ui:define name="onload">
			#{loginMB.campoLogin.elementById}.focus();
		</ui:define>

		<ui:define name="titulo">
			<h:outputText value="#{loginMB.titulo}" />
		</ui:define>
		
		<ui:define name="menu">
		</ui:define>

		<ui:define name="modalPanel">

			<rich:modalPanel id="modalPanel" width="360" height="170" onshow="#{loginMB.campoLogin.elementById}.focus();" showWhenRendered="true">

				<f:facet name="header">
		            <h:panelGroup>
		                <h:outputText value="#{loginMB.titulo}" />
		            </h:panelGroup>
		        </f:facet>
		
				<a4j:outputPanel ajaxRendered="true" id="painelMensagemModal" layout="block" style="height: 38px;"> 
						<sistema:mensagem />
		 		</a4j:outputPanel>
				
				<h:form id="#{loginMB.campoLogin.nameForm}" prependId="#{loginMB.campoLogin.prependId}">

					<fieldset class="lm" style="margin: 0;">
						<table><tr><td>
							<h:panelGrid columns="2">
					        	<h:outputText value="#{loginMB.campoLogin.nameDisplay}" />
					        	<h:inputText 	required= "true"
						        	value=      "#{loginMB.login}" 
						        	id=         "#{loginMB.campoLogin.id}"
						        	size=       "#{loginMB.campoLogin.sizeMax}" 
						        	maxlength=  "#{loginMB.campoLogin.maxlength}" 
						        	onkeypress= "#{loginMB.campoLogin.onkeypress}" >
						        		<f:validateLength minimum="#{loginMB.campoLogin.sizeMin}"  maximum="#{loginMB.campoLogin.sizeMax}" /> 
						        </h:inputText>
								<h:outputText value="#{loginMB.campoSenha.nameDisplay}" />
					        	<h:inputSecret  required= "true" 
						        	value=      "#{loginMB.senha}" 
						        	id=         "#{loginMB.campoSenha.id}"
						        	size=       "#{loginMB.campoSenha.sizeMax}" 
						        	maxlength=  "#{loginMB.campoSenha.maxlength}" 
						        	onkeypress= "#{loginMB.campoSenha.onkeypress}">
					        			<f:validateLength minimum="#{loginMB.campoSenha.sizeMin}"  maximum="#{loginMB.campoSenha.sizeMax}" /> 
							    </h:inputSecret>
							</h:panelGrid>
						</td>
						<td style="vertical-align:bottom">
				        	<a4j:commandButton id="#{loginMB.submit}" value="#{loginMB.submit}" action="#{loginMB.enviar}" styleClass="w90 pointer" reRender="modalPanel" limitToList="true" />
				        </td></tr></table>
					</fieldset>
		
					<br />
				</h:form>
				
			</rich:modalPanel>
			
		</ui:define>

	</ui:composition>

</html>